﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace Sundry.Areas.WebApi.Models
{
    /// <summary>
    /// 菜单类(获取列表)
    /// </summary>
    public class AdminMenuModel:PageModel
    {
        /// <summary>
        /// 所属父级菜单Id(-10忽略)
        /// </summary>
        [Required(ErrorMessage = "所属父级菜单Id不能为空")]
        [Range(-10, int.MaxValue, ErrorMessage = "请输入正确的范围")]
        public int ParentMenuId { get; set; }
        /// <summary>
        /// 菜单名称
        /// </summary>
        [StringLength(20, ErrorMessage = "菜单名称长度不能超过20")]
        public string MenuName { get; set; }
        /// <summary>
        /// 是否显示(-10忽略)
        /// </summary>
        [Required(ErrorMessage = "是否显示不能为空")]
        [Range(-10,int.MaxValue,ErrorMessage="请输入正确的范围")]
        public int IsShow { get; set; }
        /// <summary>
        /// 是否属于管理员菜单(-10忽略)
        /// </summary>
        [Required(ErrorMessage = "是否属于管理员菜单不能为空")]
        [Range(-10, int.MaxValue, ErrorMessage = "请输入正确的范围")]
        public int IsAdmin { get; set; }
        /// <summary>
        /// 是否属于店铺菜单(-10忽略)
        /// </summary>
        [Required(ErrorMessage = "是否属于店铺菜单不能为空")]
        [Range(-10, int.MaxValue, ErrorMessage = "请输入正确的范围")]
        public int IsStoreAdmin { get; set; }
    }

}